#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n%2)
	{
		int cnt = (n-3)/2;
		printf("%d\n",cnt+1);
		for(int i = 0;i<cnt;i++)
		{
			printf("2 ");
		}
		printf("3\n");
	}
	else
	{
		int cnt = n/2;
		printf("%d\n",cnt);
		for(int i = 0;i<cnt;i++)
		{
			if(i==0) printf("2");
			else printf(" 2");
		}
		printf("\n");
	}
}
